﻿@using Bids.Service;
@using Autofac;
@using Autofac.Integration.Mvc;
@model Bids.Core.DomainObjects.Task
           @{
               IUserContext userContext = AutofacDependencyResolver.Current.RequestLifetimeScope.Resolve<IUserContext>();
               }
<div style="color:#666666">
		
		<a name="pay"></a>
		<div class="left2">
			<div class="bg-grey pa1" id="init">
                <span class="grey">该项目正在雇主
                    @switch(Model.TaskState)
                    {
                        case Bids.Core.DomainObjects.TaskStatus.投稿中:
                            @:初稿阶段
                            break;
                            case Bids.Core.DomainObjects.TaskStatus.选稿中:
                            case Bids.Core.DomainObjects.TaskStatus.稿件确认:
                            @:审稿阶段
                            break;
                            case Bids.Core.DomainObjects.TaskStatus.已结束:
                            @:已结束
                            break;
                    }
                    </span>
                @if(Model.Designer!=null)
                {
                    @:<br>
                    @:该项目入围设计师: <span class="red" id="finalist_users">@Model.Designer.DisplayName</span>
                }

			</div>
			<div id="">
                @{
                    int i = 1;
                    int page = (int)@TempData["page"];
                  }
               
                @foreach (var item in Model.Contributions.Take(page * 6))
                {
                    <div style="margin-right:13px;" class="photo_ui" id="work_@(item.ID)">
                        <div class="div5">设计方案 <b class="red">@i</b>

                        </div>
                        <div style="border:1px solid #ccc;overflow:hidden;height:159px;" class="photo">
                           
                            <img width="210" lang="" onclick="work_start('@(item.ID)','300','周金进','3','16','http://www.logo123.net/logos/201305/20130521200249300.png','75','@(Model.TaskState == Bids.Core.DomainObjects.TaskStatus.稿件确认?1:0)','0','125565853,18656364682',jQuery('#work_message_@(item.ID)').html(),0,6);" onerror="if(application.isFF)this.src='images/no_photo.gif';" class="img1" src="http://www.logo123.net/logos/201305/20130521200249300.png" id="logo_img_113313">

                        </div>
                        <div class="left7">
                            <div class="div32">#4 by <a href="#" style="cursor:pointer;" class="font13">@item.Designer.DisplayName</a>
                                <img align="absmiddle" title="资深设计师" alt="资深设计师" class="img2" src="/images/level_3.gif">

                            </div>

                        </div>
                        <div class="right7">&nbsp;</div>

                    </div>
                    <div class="hidden" id="work_message_@(item.ID)">
                    
                        <div class='left7'><b>
                        @item.Designer.DisplayName
                            <img src='/images/level_3.gif' class='img2' alt='资深设计师' title='资深设计师' align='absmiddle' />:</b>
                        </div>
                        <div class='right7'>
                        <span class='font0'>@((DateTime.Now - item.CreateTime).Days )天前
                        </span>
                       </div>
                        <div class='clear'>
                        </div>
                        <div class='div24'>@item.LastItem.Explain</div>
                          <div class='clear'>
                        </div> 
                      
                        @foreach (var comment in item.Comments)
                    {
                        <div class='left7'>
                            <b>
                                @comment.User.DisplayName
                                @if (comment.UserId == Model.EmployerId)
                                {
                                    @:(雇主)
                                     }
                                else
                                {
                                    <img src='/images/level_3.gif' class='img2' alt='资深设计师' title='资深设计师' align='absmiddle' />
                                }
                                :</b>
                        </div>
                        <div class='right7'>
                            <span class='font0'>@((DateTime.Now - comment.CreateTime).Days)天前
                            </span>
                        </div>
                        <div class='clear'>
                        </div>
                        <div class='div24'>@comment.Content</div>
                        <div class='clear'>
                        </div> 
                    }
                    </div>
                    i++;
                }
 <div class="div8">
     <button onclick="this.disabled=true;this.style.width=this.offsetWidth+'px';this.innerHTML='请稍后...';$('page').value='@(page + 1)';get_works(@Model.ID,@(page + 1));" class="submit">显示更多...</button></div></div>
			<div class="clear"></div>
			
		</div>
		
		<div class="clear"></div>
	</div>
